home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Taifun
/
Taifun 014 (1987-05-15)(Ossowski, Stefan)(DE)(PD).zip
/
Taifun 014 (1987-05-15)(Ossowski, Stefan)(DE)(PD).adf
/
Cos
/
xBMAPS
/
cos.7a
< prev
next >
Wrap
Text File
|
1987-03-04
|
27KB
|
810 lines
' CIRCLE OF SUCCESS Steve Michel / Bill Burkhalter 10/8/86
' 2510 16th Ave. Sterling IL 61081 815-626-4157
main:
CLS: CLEAR ,30000&: RANDOMIZE TIMER
ON BREAK GOSUB ctrl.c: BREAK ON
ON MOUSE GOSUB check.mouse
ON MENU GOSUB check.menu: MENU ON
ON TIMER(1) GOSUB beeper
GOSUB initialize: GOSUB get.datafile: GOSUB get.players
next.game:
GOSUB reset.vars: GOSUB get.time: GOSUB draw.screen: GOSUB draw.names
next.round:
round = round + 1: IF round > num.players THEN final.round
LOCATE 1,15: FOR j = 1 TO 60: PRINT " ";: NEXT j
LOCATE 1,2: PRINT "ROUND "; round$(round)
GOSUB draw.alphabet: GOSUB fix.money: GOSUB get.phrase
GOSUB draw.boxes: GOSUB check.punc: player = round - 1
winner.flag = 0
next.player:
player = player + 1: IF player > num.players THEN player = 1
PAINT (moneyx,moneyy),player.color(player),1
main.loop:
GOSUB same.player: GOSUB check.vowels: IF winner.flag THEN next.round
MOUSE ON
WHILE MOUSE(0) = 0: WEND
WHILE MOUSE(0) <> 1: WEND
MOUSE OFF
IF mouse.flag = 0 THEN main.loop
ON mouse.flag GOSUB spin.wheel, solve.puzzle, buy.vowel
IF winner.flag THEN next.round
IF check.flag = 0 THEN next.player
mouse.flag = 0: GOTO main.loop
END
initialize:
SCREEN 1,640,200,4,2: WINDOW 1," CIRCLE OF SUCCESS ",,16,1
GOSUB set.color: CLS: LOCATE 2,1: PRINT " Now initializing....."
DIM phrase$(200), clue$(200), player$(4), amount(4), bank(4)
DIM dollar(18), dollar$(18), rotate%(6), round$(4)
DIM box%(100), blank%(100), inside%(100),light%(100), used%(200)
DIM bPlane&(5), cTabWork%(32), cTabSave%(32)
blank$=" ": PI = 3.14159762#
alpha$ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ": vowel$ = "AEIOU"
solve.time = 15: type.time = 15: phrases.used = 0
player.color(1)=3:player.color(2)=2:player.color(3)=15:player.color(4)=12
GET (15,17)-(30,29),blank%
LINE (15,17)-(30,29),15,b: GET (15,17)-(30,29),inside%
PAINT(20,20),14,15: GET (15,17)-(30,29),box%
PUT (15,17),blank%,AND: xapos = 204: yapos = 165
LINE (15,17)-(30,29),15,b: PAINT(20,20),13,15: GET (15,17)-(30,29),light%
FOR j = 1 TO 4: READ round$(j): NEXT j
DATA ONE, TWO, THREE, FOUR
moneyx = 31: moneyy = 161: centerx = 115: centery = 110: aspect = .44
MENU 1,0,1," ^^ COS ^^ "
MENU 1,1,1," ABOUT COS "
MENU 1,2,1," QUIT "
' MENU 2,0,1,"": MENU 3,0,1,"": MENU 4,0,1,""
RETURN
check.menu:
IF MENU(0) = 1 THEN GOSUB display
RETURN
set.color:
'grey, black, green, blue, white, aqua, green, blue, yellow, aqua, red
'white, aqua, light yellow, dark yellow, red
PALETTE 0,.5,.5,.5: PALETTE 1,0,0,0: PALETTE 2,0,1,0: PALETTE 3,0,0,1
PALETTE 4,1,1,1: PALETTE 5,0,1,1: PALETTE 6,0,1,0: PALETTE 7,0,0,1
PALETTE 8,1,.8,.2: PALETTE 9,0,1,1: PALETTE 10,.8,.2,0: PALETTE 11,1,1,1
PALETTE 12,0,1,1: PALETTE 13,1,1,.5: PALETTE 14,1,.8,.2: PALETTE 15,.8,.2,0
RETURN
get.players:
CLS: LOCATE 2,2: INPUT"ENTER NUMBER OF PLAYERS (4 MAX.) ";num.players
IF num.players < 1 OR num.players > 4 THEN get.players
CLS: FOR j = 1 TO num.players: LOCATE j*2+2,2: COLOR player.color(j)
PRINT "Enter name of player #";j;: INPUT player$(j)
player$(j)=LEFT$(player$(j),11): player$(j)=UCASE$(player$(j))
NEXT j: COLOR 1,0
RETURN
get.datafile:
ms$ = "CLICK ON DRIVE FOR COS DISK":GOSUB get.drive:cosdrive$=drive$
GOSUB check.tab
ms$ = "CLICK ON DRIVE FOR DATA DISK":GOSUB get.drive:datadrive$=drive$
CHDIR datadrive$
get.suffix:
LOCATE 4,27: PRINT " "
LOCATE 4,22: PRINT "CLICK ON DATA FILE WANTED (A-Z) ";
GOSUB draw.alphabet: GOSUB click.letter
datafile$ = "COS.DATAFILE" + letter$
OPEN "R" ,#1, datafile$
IF LOF(1) > 10 THEN file.ok
CLOSE #1: KILL datafile$: KILL datafile$+".info"
CLS: LOCATE 2,27: PRINT "THAT FILE IS NOT ON ";datadrive$
LOCATE 4,20: PRINT "INSERT CORRECT DISK OR CHECK FILE NAME."
GOSUB clicker: CLS: GOTO get.suffix
file.ok:
FIELD #1, 20 AS n$: GET #1,1:num.recs = CVS(n$):CLOSE #1
ON ERROR GOTO 0
RETURN
reset.vars:
RESTORE reset.vars: winner.flag = 0: final.flag = 0: round = 0
beepflag = 0
FOR j = 1 TO 18: READ dollar(j): NEXT j: clue$ = ""
DATA 1150,175,800,500,1250,325,750,575,650,925,200,625,475
DATA 150,675,800,1000,350
FOR j = 1 TO 6: rotate%(j) = j+5: NEXT j
FOR j = 1 TO 4: bank(j) = 0: amount(j) = 0: NEXT j
FOR j = 1 TO 200: used%(j) = 0: NEXT j
RETURN
get.time:
CLS: LOCATE 2,2: PRINT "CURRENT SOLVE TIME = ";solve.time
LOCATE 4,2: PRINT "CURRENT TYPE TIME = ";type.time
title$=" ARE THESE ACCEPTABLE ?": msg$="CLICK ON YES OR NO"
reqx1=210:reqy1=75:backcol=14:msgcol=1:outcol=15:COLOR 1,0
CALL REQUESTER: IF choice$="YES" THEN RETURN
CLS: LOCATE 2,2: INPUT "ENTER SOLVE TIME => ";solve.time
LOCATE 4,2: INPUT "ENTER TYPE TIME => ";type.time
GOTO get.time
draw.screen:
CLS: delay = 200: COLOR 1,0
phrase$="CIRCLE":GOSUB draw.boxes:GOSUB display.boxes:GOSUB erase.boxes
phrase$="OF":GOSUB draw.boxes:GOSUB display.boxes:GOSUB erase.boxes
phrase$="SUCCESS":GOSUB draw.boxes:GOSUB display.boxes:GOSUB erase.boxes
pic$ = "cos.screen.pic": GOSUB load.acbm: GOSUB draw.names
RETURN
draw.names:
FOR j = 1 TO num.players: xpos = 40+(j-1)*152
LINE (xpos-3,28)-(xpos+108,60),1,b
LINE (xpos-2,28)-(xpos+107,60),1,b
LINE (xpos-1,29)-(xpos-1,59),player.color(j)
LINE (xpos+106,29)-(xpos+106,59),player.color(j)
LINE (xpos,29)-(xpos+105,59),player.color(j),b
LINE (xpos+1,30)-(xpos+104,58),1,b: LINE (xpos+1,40)-(xpos+104,40),1
LINE (xpos+2,30)-(xpos+2,58),1: LINE(xpos+103,30)-(xpos+103,58),1
COLOR player.color(j): LOCATE 5,INT(xpos/8+2): PRINT player$(j);
NEXT j: GOSUB print.amounts
RETURN
draw.alphabet:
FOR j = 0 TO 25
PUT (j*16+xapos,yapos),inside%,OR
LOCATE 22,(j*2+27): PRINT MID$(alpha$,j+1,1);
NEXT j
RETURN
draw.boxes:
yppos = 13: length = LEN(phrase$): size = 2*length: start=(80-size)/2
xppos = (start-2)*8+4
FOR j = 0 TO length - 1
IF MID$(phrase$,j+1,1) <> " " THEN
PUT (j*16+xppos,yppos),box%
ELSE
PUT (j*16+xppos,yppos),blank%
END IF
NEXT j: LOCATE 1,(40-LEN(clue$)/2): PRINT clue$
RETURN
get.phrase:
phrases.used = phrases.used + 1:
IF phrases.used > num.recs THEN
CLS: LOCATE 2,2: PRINT "ALL THE ITEMS IN THIS FILE HAVE BEEN USED."
LOCATE 4,2: PRINT "THIS FILE MUST BE RE-USED OR ANOTHER FILE CHOSEN."
GOSUB get.spacebar
title$=" WANT TO PLAY AGAIN ?": msg$="CLICK ON YES OR NO"
reqx1=397:reqy1=77:backcol=14:msgcol=1:outcol=15:COLOR 1,0
CALL REQUESTER: IF choice$="YES" THEN RUN
GOTO ctrl.c
END IF
LOCATE 13,57: PRINT "NOW SELECTING"
LOCATE 14,57: PRINT " PUZZLE."
select = INT(num.recs * RND(1) + 1)
IF used%(select) = 1 THEN get.phrase
used%(select) = 1
OPEN "R", #1, datafile$
FIELD #1, 39 AS n$, 20 AS c$
GET #1, (select + 1)
phrase$ = n$: clue$ = c$
FOR un = 1 TO LEN(phrase$)
MID$(phrase$,un,1) = CHR$((ASC(MID$(phrase$,un,1)) + 13) XOR 13)
NEXT un
CLOSE #1
FOR j = 1 TO 38
IF MID$(phrase$,j,2) = " " THEN
phrase$ = LEFT$(phrase$,j-1)
j = 1E+09
END IF
NEXT j
FOR j = 1 TO 18
IF MID$(clue$,j,2) = " " THEN
clue$ = LEFT$(clue$,j-1)
j = 1E+09
END IF
NEXT j
GOSUB erase.msg: used.letter$ = "": keep$ = phrase$
RETURN
erase.msg:
FOR em = 13 TO 15: LOCATE em,53: PRINT blank$;: NEXT em
RETURN
draw.button:
LINE (x1,y1)-(x1+85,y1+26),1,b
LINE (x1+5,y1+3)-(x1+80,y1+23),1,b
PAINT (x1+1,y1+1),button.color,1
LINE (x1,y1)-(x1+5,y1+3),1:LINE (x1+85,y1)-(x1+80,y1+3)
LINE (x1,y1+26)-(x1+5,y1+23),1: LINE (x1+85,y1+26)-(x1+80,y1+23)
COLOR button.color: LOCATE ybutton, xbutton: PRINT b1$;
LOCATE ybutton+1,xbutton: PRINT b2$;: COLOR 1,0
RETURN
reset.color:
'blue, white, black, orange
PALETTE 0,.1,.1,1: PALETTE 1,1,1,1: PALETTE 2,0,0,0: PALETTE 3,.93,.2,0
RETURN
spin.wheel:
GOSUB erase.msg: numclicks = INT(10*RND(1)+10)
clicks = INT(6*RND(1)+4): increment = 1100 / clicks
delay = 0: LOCATE 22,6: PRINT LEFT$(blank$,18);
change.palette:
FOR sw = 1 TO numclicks
dcount = dcount + 1: IF dcount > 18 THEN dcount = 1
PALETTE rotate%(1),0,1,0: PALETTE rotate%(2),0,0,1
PALETTE rotate%(3),1,.8,.2: PALETTE rotate%(4),0,1,1
PALETTE rotate%(5),.8,.2,0: PALETTE rotate%(6),1,1,1
temp = rotate%(6)
FOR jj = 5 TO 1 STEP -1: rotate%(jj+1) = rotate%(jj): NEXT jj
rotate%(1) = temp: LOCATE 22,10: PRINT dollar$(dcount);
SOUND 1000,1,64
NEXT sw
numclicks = 1
delay = delay + increment: FOR kk = 1 TO delay: NEXT kk
IF delay < 1100 THEN change.palette
IF dollar$(dcount) = " LOSE TURN " THEN
check.flag = 0
RETURN
END IF
IF dollar$(dcount) = " BANKRUPT! " THEN
FOR kk = 1900 TO 150 STEP -75: SOUND kk,1: NEXT kk
SOUND 140,3: amount(player) = 0: check.flag = 0
GOSUB print.amounts: RETURN
END IF
GOSUB check.consonant: GOSUB check.phrase: IF check.flag = 0 THEN RETURN
GOSUB print.amounts
RETURN
display.boxes:
FOR j = 0 TO LEN(phrase$) - 1
IF MID$(phrase$,j+1,1) <> " " THEN PUT (j*16+xppos,yppos),inside%,AND
LOCATE 3,(j*2+start): PRINT MID$(phrase$,j+1,1);
FOR kk = 1 TO delay: NEXT kk
NEXT j
RETURN
erase.boxes:
FOR j = 0 TO 50: PUT (j*16,yppos),blank%,AND: NEXT j
RETURN
fix.money:
FOR j = 1 TO 18
IF round = 1 THEN skip.double
IF RND(1) > .5 THEN dollar(j) = dollar(j) * 2
skip.double:
dollar$(j) = STR$(dollar(j)): l = (11 - LEN(dollar$(j)))/2
dollar$(j) = LEFT$(blank$,l)+dollar$(j)+LEFT$(blank$,l)
dollar$(j) = LEFT$(dollar$(j),11)
NEXT j
num.killers = 1: IF round > 1 THEN num.killers = 2
FOR j = 1 TO num.killers
x = INT(RND(1)*18+1): dollar$(x) = " BANKRUPT! "
x = INT(RND(1)*18+1): dollar$(x) = " LOSE TURN "
NEXT j
FOR j = 1 TO num.players: amount(j) = 0: NEXT j: GOSUB print.amounts
RETURN
check.mouse:
currx = MOUSE(1): curry = MOUSE(2): mouse.flag = 0
IF currx>251 AND currx<338 AND curry>65 AND curry<93 THEN mouse.flag=1
IF currx>251 AND currx<338 AND curry>97 AND curry<125 THEN mouse.flag=2
IF currx>251 AND currx<338 AND curry>129 AND curry<157 THEN mouse.flag=3
IF currx>203 AND currx<621 AND curry>164 AND curry<1178 THEN mouse.flag=4
RETURN
ctrl.c:
CLS: FOR j = 1 TO 30: g$ = INKEY$: NEXT j
GOSUB reset.color: MENU RESET: SCREEN CLOSE 1
'IF loadacbm = 1 THEN CALL FreeMem&(mybuf&,mybufsize&)
STOP
check.punc:
LOCATE 13,57: PRINT "CHECKING FOR"
LOCATE 14,57: PRINT "PUNCTUATION."
FOR j = 0 TO length - 1
x$ = MID$(phrase$,j+1,1):x = ASC(x$): IF x$ = " " THEN skip.check
IF x > 64 AND x < 91 THEN skip.check
PUT (j*16+xppos,yppos),inside%,AND
PUT (j*16+xppos,yppos),light%,OR
SOUND 1900,5: FOR kk = 1 TO 1000: NEXT kk
PUT (j*16+xppos,yppos),inside%,AND
LOCATE 3,(j*2+start): PRINT MID$(phrase$,j+1,1);
MID$(phrase$,j+1,1) = " "
skip.check:
NEXT j: GOSUB erase.msg
RETURN
print.amounts:
FOR j = 1 TO num.players: xpos = 40 + (j-1) * 152
dollar$ = STR$(amount(j))
dollar$ = LEFT$(blank$,10-LEN(dollar$))+dollar$
dollar$ = "$" + dollar$
LOCATE 7,INT(xpos/8+2): COLOR player.color(j): PRINT dollar$;
NEXT j: COLOR 1,0
RETURN
check.consonant:
GOSUB erase.msg: LOCATE 13,57: PRINT "PLEASE SELECT"
LOCATE 14,57: PRINT "A CONSONANT.": GOSUB click.letter: vowel.flag = 0
FOR j = 1 TO LEN(vowel$)
IF letter$ = MID$(vowel$,j,1) THEN vowel.flag = 1
NEXT j
IF vowel.flag THEN
LOCATE 13,57: PRINT "CLICK ON A";
LOCATE 14,57: PRINT "CONSONANT,";: LOCATE 15,57: PRINT "PLEASE."
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg: GOTO check.consonant
END IF
GOSUB check.used: IF used.flag THEN check.consonant
RETURN
check.used:
used.flag = 0
FOR j = 1 TO LEN(used.letter$)
IF letter$ = MID$(used.letter$,j,1) THEN used.flag = 1
NEXT j
IF used.flag THEN
LOCATE 13,57: PRINT "THAT LETTER";
LOCATE 14,57: PRINT "IS ALREADY";: LOCATE 15,57: PRINT "USED."
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg: RETURN
END IF
used.letter$ = used.letter$ + letter$ : x = ASC(letter$) - 64
LOCATE 22,(x-1)*2+27: PRINT " ";
RETURN
check.phrase:
check.flag = 0
FOR j = 0 TO LEN(phrase$) - 1
IF letter$ <> MID$(phrase$,j+1,1) THEN skip.letter
check.flag = 1
PUT (j*16+xppos,yppos),inside%,AND
PUT (j*16+xppos,yppos),light%,OR
SOUND 1900,5: FOR kk = 1 TO 800: NEXT kk
PUT (j*16+xppos,yppos),inside%,AND
LOCATE 3,(j*2+start): PRINT MID$(phrase$,j+1,1);
MID$(phrase$,j+1,1) = " ": IF buy.flag THEN skip.letter
amount(player) = amount(player) + VAL(dollar$(dcount))
skip.letter:
NEXT j
IF final.flag THEN RETURN
IF check.flag = 0 THEN
LOCATE 13,57: PRINT "THAT LETTER IS"
LOCATE 14,57: PRINT "NOT IN PUZZLE."
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg
END IF
RETURN
click.letter:
MOUSE ON
WHILE MOUSE(0) = 0: WEND
WHILE MOUSE(0) <> 1: WEND
MOUSE OFF
IF mouse.flag <> 4 THEN click.letter
GOSUB erase.msg
IF currx<204 OR currx>620 OR curry<165 OR curry>177 THEN click.letter
x = currx - 204: x = INT(x/16) + 65: letter$ = CHR$(x)
RETURN
same.player:
LOCATE 22,6: PRINT LEFT$(blank$,18);
LOCATE 22,6: COLOR player.color(player): PRINT player$(player) +"'s turn";
COLOR 2,0:LOCATE 10,35: PRINT "SPIN";
LOCATE 11,35: PRINT "WHEEL";: COLOR 1,0
COLOR 1,0: LOCATE 13,57: PRINT "SPIN, SOLVE OR"
LOCATE 14,57: PRINT "BUY A VOWEL."
RETURN
buy.vowel:
GOSUB erase.msg
IF amount(player) < 250 THEN
LOCATE 13,57: PRINT "YOU DON'T HAVE"
LOCATE 14,57: PRINT "ENOUGH MONEY."
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg: check.flag = 1
RETURN
END IF
money.ok:
LOCATE 13,57: PRINT "PLEASE SELECT"
LOCATE 14,57: PRINT "A VOWEL."
GOSUB click.letter: vowel.flag = 0
FOR j = 1 TO LEN(vowel$)
IF letter$ = MID$(vowel$,j,1) THEN vowel.flag = 1
NEXT j
IF vowel.flag = 0 THEN
GOSUB erase.msg: LOCATE 13,57: PRINT "CLICK ON A"
LOCATE 14,57: PRINT "VOWEL,": LOCATE 15,57: PRINT "PLEASE."
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg: GOTO money.ok
END IF
GOSUB check.used: IF used.flag THEN money.ok
IF final.flag THEN RETURN
amount(player) = amount(player) - 250: GOSUB print.amounts
buy.flag = 1: GOSUB check.phrase: buy.flag = 0
RETURN
check.vowels:
FOR j = 1 TO LEN(phrase$)
x$ = MID$(phrase$,j,1): IF x$ = " " THEN skip.it
vowel.flag = 0
FOR jj = 1 TO 5
IF x$ = MID$(vowel$,jj,1) THEN vowel.flag = 1
NEXT jj
IF vowel.flag = 0 THEN RETURN
skip.it:
NEXT j
FOR j = 1 TO 3: SOUND 1900,4: FOR kk = 1 TO 100: NEXT kk: NEXT j
force.guess:
GOSUB solve.puzzle
IF winner.flag THEN RETURN
player = player + 1: IF player > num.players THEN player = 1
LOCATE 22,6: PRINT LEFT$(blank$,18);
LOCATE 22,6: COLOR player.color(player): PRINT player$(player) +"'s turn";
PAINT (moneyx,moneyy),player.color(player),1: COLOR 1,0
GOTO force.guess
solve.puzzle:
GOSUB erase.msg: COLOR player.color(player): winner.flag = 0
IF vowel.flag THEN
LOCATE 13,55
PRINT "ONLY VOWELS LEFT."
END IF
LOCATE 14,55: PRINT "ENTER YOUR GUESS"
LOCATE 15,55: PRINT "TO THE PUZZLE.": COLOR 1,0
WINDOW 2,">>> ENTER GUESS BELOW <<<",(37,38)-(604,61),0,1
WINDOW OUTPUT 2:LOCATE 2,1: size = 40:
IF final.flag THEN TIMER ON
CALL INPUTSTRING (entry$,size): TIMER OFF
WINDOW CLOSE 2: WINDOW OUTPUT 1: GOSUB erase.msg
IF final.flag THEN RETURN
IF entry$ = keep$ THEN
winner.flag = 1
LOCATE 13,55: PRINT "THAT IS CORRECT !!"
phrase$ = keep$: delay = 1: GOSUB display.boxes
ELSE
check.flag = 0
LOCATE 13,55: PRINT "SORRY, THAT IS"
LOCATE 14,55: PRINT "NOT CORRECT."
END IF
FOR kk = 1 TO 3000: NEXT kk
GOSUB erase.msg
IF winner.flag THEN
IF amount(player) = 0 THEN amount(player) = 200
bank(player) = bank(player) + amount(player)
GOSUB erase.msg: GOSUB erase.boxes
END IF
RETURN
final.round:
CLS: used.letter$ = "": final.flag = 1: winner = 1: amount = bank(1)
LOCATE 1,2: PRINT "FINAL ROUND"
FOR j = 2 TO num.players
IF bank(j) > amount THEN
winner = j
amount = bank(j)
END IF
NEXT j
GOSUB draw.msgboard: wc = player.color(winner): radius = 100
LOCATE 13,55: PRINT "ADVANCING TO THE";
LOCATE 14,55: PRINT "FINAL ROUND";
FOR j = 1 TO 6: PRINT ".";:FOR kk = 1 TO 400: NEXT kk: NEXT j: COLOR wc
LOCATE 15,55: PRINT player$(winner);: COLOR 1,0
FOR kk = 1 TO 3000: NEXT kk: GOSUB erase.msg
GOSUB get.phrase: GOSUB draw.boxes: GOSUB check.punc: GOSUB draw.alphabet
CIRCLE (centerx,centery),radius,wc
LINE (centerx,centery)-(centerx,centery-radius*aspect),wc
LOCATE 21,12: COLOR 1,14: PRINT " TIMER ": COLOR 1,0
x2=0: y2=radius*aspect: radius = 99
final$ = ""
FOR jj = 1 TO 5
GOSUB check.consonant
final$ = final$ + letter$
LOCATE 18,57+jj*2: PRINT letter$;
NEXT jj
GOSUB money.ok: final$ = final$ + letter$: LOCATE 18,69: PRINT letter$;
GOSUB erase.msg
FOR jj = 1 TO 6
letter$ = MID$(final$,jj,1)
GOSUB check.phrase
NEXT jj
GOSUB erase.msg
LOCATE 13,55: PRINT "PRESS SPACE BAR TO"
LOCATE 14,55: PRINT "ANSWER PUZZLE. YOU"
LOCATE 15,55: PRINT "HAVE";solve.time;"SECONDS."
seconds = 0: time.allowed = solve.time: TIMER ON
get.loop:
g$ = INKEY$: IF g$ <> " " THEN get.loop
TIMER STOP
LINE (centerx,centery)-(centerx+x2,centery-y2),0
LINE (centerx,centery)-(centerx,centery-radius*aspect),wc
WINDOW OUTPUT 1: GOSUB erase.msg
LOCATE 13,55: PRINT "TYPE IN ANSWER TO"
LOCATE 14,55: PRINT "THE PUZZLE. YOU"
LOCATE 15,55: PRINT "HAVE";type.time;"SECONDS."
seconds = 0: vowel.flag = 0: time.allowed = type.time
beepflag = 0: GOSUB solve.puzzle: IF beepflag THEN times.up
IF entry$ = keep$ THEN
COLOR 1,0: phrase$ = keep$: GOSUB display.boxes
LOCATE 13,55: PRINT "YOU WIN A NEW CAR!";
FOR j = 1 TO 5: FOR jj = 200 TO 2000 STEP 100: SOUND jj,.4,,0
NEXT jj: NEXT j
SCREEN CLOSE 1: SCREEN 1,320,200,5,1: CLS
pic$="cos.car.pic": GOSUB load.acbm
ELSE
LOCATE 13,55: PRINT "SO SORRY."
SOUND 261,18,,0: FOR jj = 260 TO 130 STEP -20
SOUND jj,.5,,0: NEXT jj: SOUND 130,30,,0
SCREEN CLOSE 1: SCREEN 1,320,200,5,2: CLS
pic$="cos.car.pic": GOSUB load.acbm
END IF
GOTO play.more
draw.msgboard:
LINE(400,66)-(600,130),1,b:LINE(410,71)-(590,125),1,b:PAINT(405,68),12,1
LINE(400,66)-(410,71),1: LINE(600,66)-(590,71),1
LINE(400,130)-(410,125),1:LINE(600,130)-(590,125),1
LINE(410,90)-(590,90):LINE(410,89)-(590,89):COLOR 12,0:LOCATE 11,57
PRINT "MESSAGE BOARD";:COLOR 1,0:RETURN
beeper:
seconds = seconds + 1: WINDOW OUTPUT 1: slice = INT(360 / time.allowed)
j = slice * seconds: j = 90 - j: jj = j + 2
x1 = COS(j * PI / 180)*(radius)
y1 = SIN(j * PI / 180) * aspect * (radius)
LINE (centerx,centery)-(centerx+x2,centery-y2),0
LINE (centerx,centery)-(centerx+x1,centery-y1),wc
SOUND 1900,1: x2=x1: y2=y1:COLOR 1,14
LOCATE 22,12: PRINT " ";time.allowed - seconds;" ";: COLOR 1,0
IF seconds < time.allowed THEN
WINDOW OUTPUT 2
ELSE
beepflag = 1
END IF
RETURN
times.up:
GOSUB erase.msg: radius = 100
CIRCLE (centerx,centery),radius,14:PAINT (centerx,centery),14,14
COLOR 1,14
LOCATE 13,10: PRINT " SORRY,": LOCATE 15,10: PRINT "TIME'S UP !!"
play.more:
COLOR 1,0: phrase$ = keep$
GOSUB display.boxes: FOR kk = 1 TO 3000: NEXT kk
title$=" WANT TO PLAY AGAIN ?": msg$="CLICK ON YES OR NO"
reqx1=397:reqy1=77:backcol=14:msgcol=1:outcol=15:COLOR 1,0
CALL REQUESTER: IF choice$="YES" THEN next.game
GOTO ctrl.c
SUB REQUESTER STATIC:
SHARED title$, msg$, reqx1, reqy1, backcol, msgcol, outcol, choice$
reqx2 = reqx1 + 206: reqy2 = reqy1 + 50
yesx = 23: yesy = 26: nox = 134: noy = yesy
WINDOW 2,title$,(reqx1,reqy1)-(reqx2,reqy2),0,1
WINDOW OUTPUT 2: PAINT (100,20),backcol,1
msgpad$ = " " + LEFT$(msg$,22) + " ": msglen = LEN(msgpad$)
xloc = INT((24-msglen)/2) + 1: xline = (xloc-1)*8
COLOR msgcol,14: LOCATE 2,xloc: PRINT msgpad$;
LINE (xline,7)-(xline+8*msglen-1,7),14
LINE (yesx,yesy)-(yesx+57,yesy+18),outcol,bf
COLOR msgcol,14: LOCATE 5,5: PRINT " YES ";
LINE (32,31)-(71,31),14
LINE (nox,noy)-(nox+50,noy+18),outcol,bf
LINE (144,31)-(175,31),14
LOCATE 5,19: PRINT " NO ";
WAITER:
choice$ = "none"
WHILE MOUSE(0) = 0: WEND
WHILE MOUSE(0) <> 1: WEND
xpos = MOUSE(3): ypos = MOUSE(4)
IF ypos < yesy OR ypos > yesy+18 THEN WAITER
IF xpos >= yesx AND xpos <= yesx+54 THEN choice$ = "YES"
IF xpos >= nox AND xpos <= nox+48 THEN choice$ = "NO"
IF choice$ = "none" THEN WAITER
WINDOW CLOSE 2
END SUB
SUB INPUTSTRING (entry$,strlen) STATIC:
SHARED beepflag
input.string:
g$ = INKEY$: IF g$ <> "" THEN input.string
entry$ = "": backspace$ = CHR$(8) + "_" + CHR$(8): counter = 0
next.key:
PRINT "_";: FOR kk = 1 TO 50: NEXT kk: PRINT backspace$;
g$ = INKEY$: IF g$ = "" THEN next.key
g$ = UCASE$(g$): ascii = ASC(g$)
IF ascii = 13 OR beepflag = 1 THEN leave.sub
IF ascii = 8 THEN back.up
IF ascii < 32 OR ascii > 90 THEN next.key
IF counter = strlen THEN next.key
PRINT g$;: entry$ = entry$ + g$
counter = counter + 1: GOTO next.key
back.up:
IF entry$ = "" THEN next.key
PRINT backspace$;:counter = counter - 1
IF LEN(entry$) < 2 THEN entry$ = "": GOTO next.key
entry$ = LEFT$(entry$,LEN(entry$)-1): GOTO next.key
leave.sub:
END SUB
display:
IF MENU(1) = 2 THEN ctrl.c
CLS: LOCATE 2,25
PRINT "WELCOME TO CIRCLE OF SUCCESS!": PRINT
PRINT " This program is fully functional as it now stands and is accompanied"
PRINT " by a sample data file named COS.DATAFILEA, whick contains 25 phrases."
PRINT " To use this file, simply enter the letter 'A' when the program prompts"
PRINT " for a filename.": PRINT
PRINT " Full blown data files (A-J) which contain 200 items apiece are now"
PRINT " available, with data files (K-Z) probably ready by the time you read"
PRINT " this. A data file generator program is also available if you wish to"
PRINT " create data files of your own. The pre-made data files and/or file "
PRINT " generator may be ordered as listed below. Happy spinning !!!"
PRINT
PRINT " ORDER FROM: STERLINGWARE
PRINT " 2510 16TH AVE.
PRINT " STERLING IL 61081
PRINT " ATTN: STEVE MICHEL
PRINT
PRINT " DATA FILES $8.95 each (specify file name(s), A-Z)
PRINT " DATA FILE GENERATOR $24.95"
get.drive:
CLS: LOCATE 2,((80-LEN(ms$))/2)
PRINT ms$
LOCATE 4,36: PRINT "0 1"
GOSUB clicker: CLS:
IF MOUSE(3) < 320 THEN
drive$ = "DF0:"
ELSE
drive$ = "DF1:"
END IF
RETURN
check.tab:
ON ERROR GOTO check.disk: CHDIR cosdrive$
try.again:
OPEN "r" , #1, "checktab"
IF ERR = 70 THEN try.again
CLOSE #1: KILL "checktab": ON ERROR GOTO 0
RETURN
clicker:
LOCATE 23,30: PRINT "CLICK LEFT MOUSE BUTTON";
WHILE MOUSE(0) = 0: WEND
WHILE MOUSE(0) <> 1: WEND
LOCATE 23,30: PRINT " ";
RETURN
check.disk:
IF ERR = 70 THEN
CLOSE #1: CLS
LOCATE 2,20: PRINT "Put write protect tab in covered position."
GOSUB clicker: CLS: RESUME
ELSE
GOTO ctrl.c
END IF
load.acbm:
REM - by Carolyn Scheppner CBM 04/86 --- THANKS CAROLYN
IF loadacbm = 1 THEN skip.declares
DECLARE FUNCTION xOpen& LIBRARY
DECLARE FUNCTION xRead& LIBRARY
DECLARE FUNCTION xWrite& LIBRARY
DECLARE FUNCTION IoErr& LIBRARY
DECLARE FUNCTION AllocMem&() LIBRARY
CHDIR cosdrive$ + "xBMAPS":LIBRARY "dos.library": LIBRARY "exec.library"
LIBRARY "graphics.library": CHDIR cosdrive$
skip.declares:
fHandle& = 0: mybuf& = 0: foundBMHD = 0
foundCMAP = 0: foundCAMG = 0: foundCCRT = 0: foundABIT = 0
filename$ = pic$ + CHR$(0)
fHandle& = xOpen&(SADD(filename$),1005)
ClearPublic& = 65537&: mybufsize& = 360
mybuf& = AllocMem&(mybufsize&,ClearPublic&)
inbuf& = mybuf&
cbuf& = mybuf& + 120
ctab& = mybuf& + 240
rLen& = xRead&(fHandle&,inbuf&,12)
tt$ = ""
FOR kk = 8 TO 11
tt% = PEEK(inbuf& + kk)
tt$ = tt$ + CHR$(tt%)
NEXT
ChunkLoop:
rLen& = xRead&(fHandle&,inbuf&,8)
icLen& = PEEKL(inbuf& + 4)
tt$ = ""
FOR kk = 0 TO 3
tt% = PEEK(inbuf& + kk)
tt$ = tt$ + CHR$(tt%)
NEXT
IF tt$ = "BMHD" THEN 'BitMap header
foundBMHD = 1
rLen& = xRead&(fHandle&,inbuf&,icLen&)
iWidth% = PEEKW(inbuf&)
iHeight% = PEEKW(inbuf& + 2)
iDepth% = PEEK(inbuf& + 8)
iCompr% = PEEK(inbuf& + 10)
scrWidth% = PEEKW(inbuf& + 16)
scrHeight% = PEEKW(inbuf& + 18)
iRowBytes% = iWidth% /8
scrRowBytes% = scrWidth% / 8
nColors% = 2^(iDepth%)
REM - Enough free ram to display ?
AvailRam& = FRE(-1)
NeededRam& = ((scrWidth%/8)*scrHeight%*(iDepth%+1))+5000
IF AvailRam& < NeededRam& THEN
loadError$ = "Not enough free ram."
STOP
END IF
kk = 1
IF scrWidth% > 320 THEN kk = kk + 1
IF scrHeight% > 200 THEN kk = kk + 2
GOSUB GetScrAddrs
REM - Black out screen
CALL LoadRGB4&(sViewPort&,ctab&,nColors%)
ELSEIF tt$ = "CMAP" THEN 'ColorMap
foundCMAP = 1
rLen& = xRead&(fHandle&,cbuf&,icLen&)
REM - Build Color Table
FOR kk = 0 TO nColors% - 1
red% = PEEK(cbuf&+(kk*3))
gre% = PEEK(cbuf&+(kk*3)+1)
blu% = PEEK(cbuf&+(kk*3)+2)
regTemp% = (red%*16)+(gre%)+(blu%/16)
POKEW(ctab&+(2*kk)),regTemp%
NEXT
ELSEIF tt$ = "CAMG" THEN 'Amiga ViewPort Modes
foundCAMG = 1
rLen& = xRead&(fHandle&,inbuf&,icLen&)
camgModes& = PEEKL(inbuf&)
ELSEIF tt$ = "CCRT" THEN 'Graphicraft color cycle info
foundCCRT = 1
rLen& = xRead&(fHandle&,inbuf&,icLen&)
ccrtDir% = PEEKW(inbuf&)
ccrtStart% = PEEK(inbuf& + 2)
ccrtEnd% = PEEK(inbuf& + 3)
ccrtSecs& = PEEKL(inbuf& + 4)
ccrtMics& = PEEKL(inbuf& + 8)
ELSEIF tt$ = "ABIT" THEN 'Contiguous BitMap
foundABIT = 1
plSize& = (scrWidth%/8) * scrHeight%
FOR pp = 0 TO iDepth% -1
rLen& = xRead&(fHandle&,bPlane&(pp),plSize&)
NEXT
ELSE
FOR kk = 1 TO icLen&
rLen& = xRead&(fHandle&,inbuf&,1)
NEXT
REM - If odd length, read 1 more byte
IF (icLen& OR 1) = icLen& THEN
rLen& = xRead&(fHandle&,inbuf&,1)
END IF
END IF
IF foundBMHD AND foundCMAP AND foundABIT THEN
GOTO GoodLoad
END IF
IF rLen& > 0 THEN GOTO ChunkLoop
GoodLoad:
loadError$ =""
IF foundCMAP THEN
CALL LoadRGB4&(sViewPort&,ctab&,nColors%)
END IF
cleanup:
CALL xClose&(fHandle&)
CALL FreeMem&(mybuf&,mybufsize&)
loadacbm = 1
RETURN
GetScrAddrs:
sWindow& = WINDOW(7)
sScreen& = PEEKL(sWindow& + 46)
sViewPort& = sScreen& + 44
sRastPort& = sScreen& + 84
sColorMap& = PEEKL(sViewPort& + 4)
colorTab& = PEEKL(sColorMap& + 4)
sBitMap& = PEEKL(sRastPort& + 4)
scrWidth% = PEEKW(sScreen& + 12)
scrHeight% = PEEKW(sScreen& + 14)
scrDepth% = PEEK(sBitMap& + 5)
nColors% = 2^scrDepth%
FOR kk = 0 TO scrDepth% - 1
bPlane&(kk) = PEEKL(sBitMap&+8+(kk*4))
NEXT
RETURN